{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The result of the integration is: 3.1415926535897967\n",
      "The estimated error is: 2.0004704559539732e-09\n"
     ]
    }
   ],
   "source": [
    "from scipy.integrate import quad\n",
    "import numpy as np\n",
    "\n",
    "def integrand(x):\n",
    "    return (x**3*np.cos(x/2)+1/2)*np.sqrt(4-x**2)\n",
    "\n",
    "result, error = quad(integrand,-2, 2)\n",
    "\n",
    "print(\"The result of the integration is:\", result)\n",
    "print(\"The estimated error is:\", error)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "qwenv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
